package com.webcamtracker.image.color.gevers;

import com.webcamtracker.image.Color;
import com.webcamtracker.image.color.ColorSpaceConversions;
import com.webcamtracker.image.color.rgb.ColorSampler;
import com.webcamtracker.image.color.rgb.RGBColor;

import java.awt.image.BufferedImage;

public class GeversColorSampler implements ColorSampler {

    public com.webcamtracker.image.Color getColorAt(BufferedImage image, int i, int e) {
        int rgb = image.getRGB(i, e);
        return ColorSpaceConversions.fromRGBtoGevers(new RGBColor(rgb));
    }

    public Color getColorFrom(RGBColor color) {
        return ColorSpaceConversions.fromRGBtoGevers(color);
    }
}
